#include "../pch.h"

namespace BFX
{

REFXMLLinkedNode::REFXMLLinkedNode() :
		REFXMLNode()
{
	m_pPrev = NULL;
}

REFXMLLinkedNode::REFXMLLinkedNode(REFXMLDocument* pDoc) :
		REFXMLNode(pDoc)
{
	m_pPrev = NULL;
}

REFXMLLinkedNode::~REFXMLLinkedNode()
{
}

// Gets the node immediately preceding this node.
REFXMLNode* REFXMLLinkedNode::GetPreviousSibling() const
{
	REFXMLNode* pParent = GetParentNode();
	if (pParent != NULL)
	{
		if (m_pPrev != pParent->GetLastChild())
			return m_pPrev;
	}
	return NULL;
}

// Gets the node immediately following this node.
REFXMLNode* REFXMLLinkedNode::GetNextSibling() const
{
	REFXMLNode* pParent = GetParentNode();
	if (pParent != NULL)
	{
		if (m_pNext != pParent->GetFirstChild())
			return m_pNext;
	}
	return NULL;
}

}	//	namespace BFX
